spb/cancerindex
Public
TypeScript 97.2%
SQL 1.5%
CSS 0.6%
JavaScript 0.5%
1import { ogImage, OG_SIZE, OG_CONTENT_TYPE } from '@/lib/og';2import { getBiomarkerBySlug } from '@/lib/queries/biomarkers';3import { humanize } from '@/lib/format';45export const alt = 'CancerIndex biomarker page';6export const size = OG_SIZE;7export const contentType = OG_CONTENT_TYPE;8export const revalidate = 3600;910export default async function Image({ params }: { params: Promise<{ slug: string }> }) {11 const { slug } = await params;12 const b = await getBiomarkerBySlug(slug);13 if (!b) return ogImage({ kicker: 'Biomarker', title: 'Biomarker not found', subtitle: slug });14 const genes = (b.gene_symbols ?? []).slice(0, 4).join(', ');15 return ogImage({16 kicker: `Biomarker · ${humanize(b.kind)}${b.ncit_code ? ` · NCIt ${b.ncit_code}` : ''}`,17 title: b.name,18 subtitle: b.description ?? (genes ? `Anchor gene${genes.includes(',') ? 's' : ''}: ${genes}` : 'Curated biomarker with derived links to cancers, drugs, approvals and trials.'),19 facts: genes ? [{ label: 'anchor genes', value: genes }] : [],20 sourcesNote: 'NCIt (EVS) · CIViC · openFDA / Health Canada / EMA · ClinicalTrials.gov',21 });22}23